# -*- coding: utf-8 -*-
import os
import sys

liber_dir = os.path.dirname(__file__).replace("\\", "/")
if liber_dir not in sys.path:
    sys.path.append(liber_dir)


from liberHook.out_of_dcc_create import execute as register_toolset


if __name__ == "__main__":
    import optparse
    parser = optparse.OptionParser()
    parser.add_option("-l", dest="library", help="a library name.", metavar="string")
    parser.add_option("-d", dest="directory", help="the directory you want to add toolset.", metavar="string")
    parser.add_option("-n", dest="name", help="the toolset name.", metavar="string")
    parser.add_option("-f", dest="files", help="the files you want to upload to the library, use\",\"to split.",
                      metavar="string")
    parser.add_option("-c", dest="comments", help="comments", metavar="string")
    parser.add_option("-t", dest="thumbnail", help="thumbnail path, must .png", metavar="string")
    options, args = parser.parse_args()
    library = options.library
    _dir = options.directory
    name = options.name
    files = options.files.split(",")
    comments = options.comments
    thumbnail = options.thumbnail
    register_toolset(library, _dir, name, files, comments, thumbnail)
    print "done"
